<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to Add AJAX Validation to Forms with jQuery</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" ></script> 
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.5.5/jquery.validate.min.js"></script>
<script type="text/javascript">
 $(document).ready(function(){  
    $("#ajaxform").validate({
							rules: {
							password: {required: true, minlength: 6},
							password_again: {required: true, equalTo: "#password"}
							}
							}); 

 });  

</script>
</head>

<body>

<div id="wrapper">
	<form action="#" method="post" id="ajaxform">
    	<fieldset>
        	<p><label for="name">Name:</label><br />
            <input type="text" name="name" value="" class="required" /></p>
            
            <p><label for="email">Email:</label><br />
            <input type="text" name="email" value="" class="required email" /></p>
            
            <p><label for="password">Password:</label><br />
            <input type="password" name="password" value="" id="password" /></p>
            
            <p><label for="password_again">Re-enter Password:</label><br />
            <input type="password" name="password_again" value="" id="password_again" /></p>
            
            <p><input type="submit" name="submit" value="Submit" /></p>
        </fieldset>	
    </form>
</div><!--close wrapper-->
</body>
</html>
